package 基础语法;

public class 就近原则与this {

    public static void main(String[] args) {

        A a = new A();
        a.getA();
        a.setS("asas");
    }

}

class A {
    private int a = 10;
    private int b = 40;
    private String s;

    public void getA() {
        int a = 20;
        System.out.println(a);
        System.out.println(b);
        System.out.println(this.a);
    }

    int k;

    public void setS(String s) {
        s = s;
        System.out.println(this.s);
        this.s = s;
        System.out.println(this.s);
        s = s + "add";
        System.out.println(s);
    }
}